package Day009_Map_斗地主_冒泡排序.ZuoYe;

import java.util.HashMap;

public class Test2 {
    public static void main(String[] args) {
        String str= "fje你kw我FDQFj你feAF他Eajf他eo2FA我FEjfew";

        //创建集合
        HashMap<Character,Integer> map = new HashMap<>();
        //遍历字符串
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            boolean b = map.containsKey(c);
                if (b == false){
                    map.put(c,1);
                } else{
                    Integer i1 = map.get(c);
                    map.put(c,++i1);
                }
        }
        System.out.println(map);
    }
}
